#ifndef __CREGISTRY_H__
#define __CREGISTRY_H__

#pragma warning(push, 3)
#include "Mkylib.h"
#pragma warning(pop)

class CRegistry
{
public:
    CRegistry(void);
    virtual ~CRegistry(void);

    static bool DeleteKey(HKEY hKey, LPCTSTR szKey);

    bool    OpenKey(HKEY hKey, LPCTSTR szkey);
    bool    OpenKey(HKEY hKey, LPCTSTR szkey, REGSAM samDesired);
    bool    CreateKey(HKEY hKey, LPCTSTR szkey);
    bool    GetValue(LPCTSTR lpValueName, tchar* szBuffer, int nBufSize);
    bool    GetValue(LPCTSTR lpValueName, DWORD& dwValue);
    bool    SetValue(LPCTSTR lpValueName, LPCTSTR lpData);
    bool    SetValue(LPCTSTR lpValueName, DWORD dwValue);
    bool    SaveKey(LPCTSTR lpszFileName);
    bool    RestoreKey(LPCTSTR lpszFileName, DWORD dwFlag);
    bool    LoadKey(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR lpszFileName);
    bool    DeleteValue(LPCTSTR lpValueName);
    void    CloseKey();

	//////////////////////////////////////////////////////////////////////////
	// 
	bool	EnableReg(bool bTrue = true);
protected:
    HKEY m_hKey;
};

#endif